<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 权限列表 -->
    <el-card>
      <el-table :data="rightsList" style="width: 100%" border stripe>
        <el-table-column type="index"></el-table-column>
        <el-table-column prop="authName" label="权限名称"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop="level" label="权限等级">
            <!-- <el-button type="primary" size='mini' plain>一级</el-button> -->
            <!-- <el-button type="success" size='mini' plain>二级</el-button>
            <el-button type="warning" size='mini' plain>三级</el-button> -->
            <!-- <el-tag v-if="level=='0'">一级</el-tag>
              <el-tag v-else-if="level=='1'" type="success">二级</el-tag>
              <el-tag v-else type="warning">三级</el-tag> -->
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 保存用户权限列表
      rightsList: [],
      //   保存用户等级
      rightLevel:[]
    };
  },

  methods: {
    async getRights() {
      const res = await this.axios.get("rights/list");
      console.log(res);
      if (res.meta.status == 200) {
        this.rightsList = res.data;
        console.log(this.rightsList);
      }
    }
  },

  created() {
    this.getRights();
  }
};
</script>

<style lang='less' scoped>
</style>
